# Define your item pipelines here
#
import os, os.path
import csv

from scrapy.conf import settings
from scrapy.core.exceptions import DropItem

class TaskLogPipeline(object):
    def __init__(self):
        filename = os.path.join(settings['DOUBAN_PATH'], 'subjects.csv')
        
        self.csvwriter = csv.writer(open(filename, 'wb'))
        
    def process_item(self, domain, item):
        self.csvwriter.writerow([item['id'], item['url']])
            
        return item